package com.permission_demo.controller;

import com.permission_demo.annotation.Permission;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/user")
@Permission(code = "user_manage",desc = "用户管理")
public class UserController {

    @Permission(code = "add",desc = "新增")
    @GetMapping(value = "/add")
    public String add(){
        return "新增用户";
    }

    @Permission(code = "view",desc = "查看")
    @GetMapping(value = "/view")
    public String view(){
        return "查看用户";
    }

}
